﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebDauGia.Domain.Abstract;

namespace WebDauGia.Controllers
{
    public class NavController : Controller
    {
        //
        // GET: /Nav/
        private WebRepository repository;
        public NavController(WebRepository repo) {
            repository = repo;
        }
        public PartialViewResult Menu(string Loaisp=null) {
            ViewBag.SelectedCategory = Loaisp;
            /*IEnumerable<string> loaisp = repository.SanPhams
                .Select(x => x.idloaisp.ToString())
                .Distinct()
                .OrderBy(x => x);*/
            IEnumerable<string> loaisp = repository.LoaiSanPhams
                .Select(x => x.id.ToString())
                .Distinct()
                .OrderBy(x => x);
            return PartialView(loaisp);
        }
        public ActionResult Slider()
        {
            return PartialView();
        }
        public ActionResult GioiThieu()
        {
            return View();
        }
        public ActionResult LienHe()
        {
            return View();
        }
        /*public ActionResult MenuDanhMuc()
        {
            return PartialView();
        }*/
    }
}
